import { defineConfig } from "vitepress";
import gin from "./gin.mjs";
import docker from "./docker.mjs";
import goMicro from "./go-micro.mjs";
import gorm from "./gorm.json";

// https://vitepress.dev/reference/site-config
export default defineConfig({
    title: "Go Lang World",
    description: "A VitePress Site",
    base: "/study-go/",
    themeConfig: {
        // https://vitepress.dev/reference/default-theme-config
        nav: [
            { text: "Home", link: "/" },
            { text: "Gin", link: "/gin/" },
            { text: "Docker", link: "/docker/" },
            { text: "Go Micro", link: "/go-micro/" },
            { text: "Gorm", link: "/gorm/" },
            { text: "更新日志", link: "/log" },
            { text: "关于作者", link: "/me" },
        ],

        sidebar: {
            "/gorm/": gorm,
            "/go-micro/": [
                {
                    text: "基础",
                    items: goMicro,
                },
            ],
            "/docker/": [
                {
                    text: "基础",
                    items: docker,
                },
            ],
            "/gin/": gin,
            "/": [
                {
                    text: "基础",
                    items: [
                        { text: "环境安装", link: "/install" },
                        { text: "变量", link: "/variable" },
                        { text: "数组", link: "/array" },
                        { text: "循环", link: "/loop" },
                        { text: "函数", link: "/function" },
                        { text: "接口", link: "/interface" },
                        { text: "包", link: "/package" },
                        { text: "面向对象", link: "/object-oriented" },
                    ],
                },
            ],
        },

        socialLinks: [
            { icon: "github", link: "https://github.com/vuejs/vitepress" },
        ],
    },
    vite: {
        resolve: {
            alias: [
                {
                    find: "$$",
                    replacement: "D:/Project/go-example",
                },
            ],
        },
    },
});
